home *** CD-ROM | disk | FTP | other *** search
/ Get a Grip Tennis by Wilson / Get a Grip Tennis by Wilson.iso / pc / wilson.dxr / Internal_52_General Button Control (for QT scrub).ls < prev    next >
Encoding:
Text File  |  2003-08-12  |  3.7 KB  |  98 lines

  1. property pMySprite, pMyMember, pCurrentSpriteCursor, pMouseOver, pMouseDown, pMouseEnterSound, pMouseDownSound, pEnterSoundFlag, pDownSoundFlag, pSoundChannel, pCursorFlag, pCursorMO, pCursorMD, pMarker, pProcessMarker, pMUScript, pProcessRollovers
  2.  
  3. on beginSprite me
  4.   pMySprite = me.spriteNum
  5.   pMyMember = sprite(pMySprite).member
  6.   pCurrentSpriteCursor = -1
  7. end
  8.  
  9. on endSprite me
  10.   cursor(pCurrentSpriteCursor)
  11. end
  12.  
  13. on mouseEnter me
  14.   if pProcessRollovers then
  15.     sprite(pMySprite).member = pMouseOver
  16.   end if
  17.   if pEnterSoundFlag then
  18.     puppetSound(pSoundChannel, pMouseEnterSound)
  19.   end if
  20.   if pCursorFlag and (the mouseDown = 0) then
  21.     cursor(pCursorMO)
  22.   end if
  23. end
  24.  
  25. on mouseLeave me
  26.   if the mouseDown = 0 then
  27.     cursor(pCurrentSpriteCursor)
  28.     if pProcessRollovers then
  29.       sprite(pMySprite).member = pMyMember
  30.     end if
  31.   end if
  32. end
  33.  
  34. on mouseDown me
  35.   if pProcessRollovers then
  36.     sprite(pMySprite).member = pMouseDown
  37.   end if
  38.   if pDownSoundFlag then
  39.     puppetSound(pSoundChannel, pMouseDownSound)
  40.   end if
  41.   if pCursorFlag then
  42.     cursor(pCursorMD)
  43.   end if
  44. end
  45.  
  46. on mouseUp me
  47.   if pCursorFlag and pProcessMarker then
  48.     sprite(pMySprite).cursor = pCurrentSpriteCursor
  49.     go(pMarker)
  50.   else
  51.     if pProcessMarker then
  52.       go(pMarker)
  53.     else
  54.       if pCursorFlag then
  55.         cursor(pCursorMO)
  56.       end if
  57.     end if
  58.   end if
  59.   do(pMUScript)
  60. end
  61.  
  62. on mouseUpOutSide me
  63.   cursor(pCurrentSpriteCursor)
  64. end
  65.  
  66. on getPropertyDescriptionList
  67.   pdlist = [:]
  68.   thisMember = sprite(the currentSpriteNum).member
  69.   thisMemberNum = thisMember.number
  70.   overMem = thisMember
  71.   downMem = thisMember
  72.   if member(thisMemberNum + 1).type = #bitmap then
  73.     overMem = member(thisMemberNum + 1)
  74.   end if
  75.   if member(thisMemberNum + 2).type = #bitmap then
  76.     downMem = member(thisMemberNum + 2)
  77.   end if
  78.   addProp(pdlist, #pProcessRollovers, [#comment: "process rollovers: ", #format: #boolean, #default: 1])
  79.   addProp(pdlist, #pMouseOver, [#comment: "mouseOver image: ", #format: #bitmap, #default: overMem])
  80.   addProp(pdlist, #pMouseDown, [#comment: "mouseDown image: ", #format: #bitmap, #default: downMem])
  81.   addProp(pdlist, #pProcessMarker, [#comment: "process jump to marker: ", #format: #boolean, #default: 1])
  82.   addProp(pdlist, #pMarker, [#comment: "which marker on mouseUp: ", #format: #marker, #default: #next])
  83.   addProp(pdlist, #pEnterSoundFlag, [#comment: "play mouseEnter sound: ", #format: #boolean, #default: 0])
  84.   addProp(pdlist, #pMouseEnterSound, [#comment: "which sound: ", #format: #sound, #default: #none])
  85.   addProp(pdlist, #pDownSoundFlag, [#comment: "play mouseDown sound: ", #format: #boolean, #default: 0])
  86.   addProp(pdlist, #pMouseDownSound, [#comment: "which sound: ", #format: #sound, #default: #none])
  87.   addProp(pdlist, #pSoundChannel, [#comment: "sound channel: ", #format: #integer, #default: 2, #range: [#min: 1, #max: 8]])
  88.   addProp(pdlist, #pCursorFlag, [#comment: "change cursor: ", #format: #boolean, #default: 1])
  89.   addProp(pdlist, #pCursorMO, [#comment: "mouseOver cursor: ", #format: #cursor, #default: 280])
  90.   addProp(pdlist, #pCursorMD, [#comment: "mouseDown cursor: ", #format: #cursor, #default: 280])
  91.   addProp(pdlist, #pMUScript, [#comment: "mouseUp command: ", #format: #string, #default: EMPTY])
  92.   return pdlist
  93. end
  94.  
  95. on getBehaviorDescription
  96.   return "A nice general button control.  Developer has the ability to set mouseOver and mouseDown states for the button, which marker to go to, whether or not to play a sound on mouseEnter and/or mouseDown, and if the cursor should change on mouseOver and mouseDown." & RETURN & RETURN & "Hilite states must be bitmaps (not SWFs)." & RETURN & "Sounds must be internal (not SWAs)." & RETURN & "Cursors must be D7+ cursors (not custom)."
  97. end
  98.